//symbol 补充
console.log(Symbol("foo") === Symbol("foo")); //false
const s1 = Symbol.for("foo");
const s2 = Symbol.for("foo");
console.log(s1 === s2); //true
console.log(Symbol.for(true) === Symbol("true")); //true

const obj = {
  [Symbol.toStringTag]: "XObject",
};
console.log(obj.toString()); //[object XObject]

const obj1 = {
  [Symbol()]: "symbol value",
  foo: "normal value",
};

for (let key in obj1) {
  console.log(key); //foo
}

console.log(Object.keys(obj1)); //[ 'foo' ]

console.log(JSON.stringify(obj1)); //{"foo":"normal value"}

console.log(Object.getOwnPropertySymbols(obj1)); //[ Symbol() ]
console.log(obj1[Object.getOwnPropertySymbols(obj1)[0]]); //symbol value
